<div class="well">
	<div class="navbar">
		<div class="navbar-inner">
			<i class="icon-chevron-right icon-white"></i> 
			<?php echo (Yii::app()->user->isGuest)?"Đăng nhập":"Học viên"?>
		</div>
	</div>
	<div class="row-fluid" id="login">
		<?php if(Yii::app()->user->isGuest) {?>
		<?php $form=$this->beginWidget('CActiveForm', array(
							  'id'=>'loginForm',
							  'enableAjaxValidation'=>false,
							  'action'=> Yii::app()->request->baseUrl . '/site/login',
)); ?>
			<label>Tên đăng nhập</label> 
			<?php echo $form->textField($model,'username',array('placeholder'=>'Tên đăng nhập','required'=>'required')); ?>
			<label>Mật khẩu</label> 
			<?php echo $form->passwordField($model,'password',array('placeholder'=>'******','required'=>'required')); ?>
			<div class="pull-left">
				<?php echo CHtml::submitButton('Đăng nhập', array('class'=>'btn btn-success')); ?>
				<?php echo $form->checkBox($model,'rememberMe',array('id'=>'rememberMe')); ?>
				<label for="rememberMe">Ghi nhớ</label>
			</div>
			<div class="clearfix"></div>
			<span class="forget pull-left"> 
				<a href="<?php echo Yii::app()->baseUrl?>/site/forgotPassword">Quên mật khẩu?</a> <br> 
				<a href="<?php echo Yii::app()->baseUrl?>/register">Bạn chưa có tài khoản?</a> 
			</span>
		<?php $this->endWidget(); ?>
		<?php } else {?>
			<img class="img-polaroid img-rounded" id="avatar" alt="avatar" src="<?php echo $avatar ?>">
  		<div id="user">
  			<i class="icon-hand-right"></i> Xin chào <b><?php echo  Yii::app()->user->username?></b>
  			<ul>
  				<?php if(!checkStudent(Yii::app()->user->id)) {?>
  				<li><a href="<?php echo Yii::app()->baseUrl?>/admin">Trang quản trị</a></li>
  				<?php }?>
  				<li><a href="<?php echo Yii::app()->baseUrl?>/user/profile">Trang cá nhân</a></li>
  				<li><a href="<?php echo Yii::app()->baseUrl?>/user/balance">Số dư tài khoản <b><?php echo UserBalance::model()->getBalance(Yii::app()->user->id)?></b> VND</a></li>
  				<?php if(checkStudent(Yii::app()->user->id)) {?>
  				<li><a href="#">Lịch sử học tập</a></li>
  				<?php }?>
  				<li><a href="<?php echo Yii::app()->baseUrl?>/site/logout">Đăng xuất</a></li>
  			</ul>
  		</div>
  		<a href="<?php echo Yii::app()->baseUrl?>/user/balance#deposit"><button type="button" class="deposit btn btn-danger">Nạp thẻ VIP</button></a>
		<?php } ?>
	</div>
</div>
